#ifndef MOVABLE_H
#define MOVABLE_H

#include "GameObject.h"

#include <string>


// Subclass of game object that can move.
// Classes can inherit this class and implement 
// the getDesiredMove function to handle movement.
class Movable: public GameObject
{
public:
	// enumeration with the different item types.
	enum InventoryItem
	{
		InventoryItem_Key,
		InventoryItem_GateKey,
		InventoryItem_Gold,
		InventoryItem_Count // Should stay at bottom
	};

	Movable(int x, int y, bool timed, Type type);
	virtual ~Movable() {}

	// Subclasses can implement getTimeDesiredMove to determine movement type.
	void getDesiredMove(int& hDirection, int& vDirection);
	virtual void getTimedDesiredMove(int& hDirection, int& vDirection);
    
    void getVelocity(int& hCur, int& vCur) const;
    void setVelocity(int hNew, int vNew);
	
	// Functions to manage inventory
	void addToInventory(InventoryItem item, int quantity = 1);
	bool hasInInventory(InventoryItem item) const;
	int getInventoryQuantity(InventoryItem item) const;
	void removeFromInventory(InventoryItem item, int quantity = 1);
	
	void setName(const std::string& name);
	std::string getName() const;

protected:
	int hVelocity;
	int vVelocity;

	int inventory[InventoryItem_Count];
	
	const bool timed;
	long timeOfLastMove;
	int moveInterval; // In milliseconds.

private:
	std::string name;
};

#endif